package mytest.ssw.www.mylibrary;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/4/2 0002.
 */
public class DeptNode {
    private String id;
    private String num;
    private String name;
    private String fullName;
    private String pNum;
    private int level;
    private boolean leaf;
    private int orderNum;
    private boolean valid;
    private boolean expand = false;
    private List<DeptNode> children = new ArrayList<DeptNode>();
    private int icon;
    private DeptNode parent;
    private int selectFlag=0;//选中状态 0未选 1半选 2选中
    private int selectIcon;

    public int getSelectIcon() {
        return selectIcon;
    }

    public void setSelectIcon(int selectIcon) {
        this.selectIcon = selectIcon;
    }

    public int getSelectFlag() {
        return selectFlag;
    }

    public void setSelectFlag(int selectFlag) {
        this.selectFlag = selectFlag;
    }

    public int getIcon() {
            return icon;
        }

    public void setIcon(int icon) {
            this.icon = icon;
        }

    public boolean isRoot()
    {
        return parent == null;
    }

    public DeptNode getParent() {
        return parent;
    }

    public void setParent(DeptNode parent) {
        this.parent = parent;
    }

    public boolean isParentExpand() {
        if (parent == null)
            return false;
        return parent.isExpand();
    }

    public List<DeptNode> getChildren() {
        return children;
    }

    public void setChildren(List<DeptNode> children) {
        this.children = children;
    }

    public boolean isExpand() {
        return expand;
    }

    public void setExpand(boolean expand) {
        this.expand = expand;
        if (!expand)
        {
            for (DeptNode node : children)
            {
                node.setExpand(expand);
            }
        }
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public String getpNum() {
        return pNum;
    }

    public void setpNum(String pNum) {
        this.pNum = pNum;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public boolean isLeaf() {
        return leaf;
    }

    public void setLeaf(boolean leaf) {
        this.leaf = leaf;
    }

    public int getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(int orderNum) {
        this.orderNum = orderNum;
    }

    public boolean isValid() {
        return valid;
    }

    public void setValid(boolean valid) {
        this.valid = valid;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

}
